﻿/* 
 * Since 2008 - 2012
 */

package com.hh.bss.project.service.impl;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.*;

import com.hh.bss.base.*;
import com.hh.bss.common.page.*;
import com.hh.bss.common.page.impl.*;
import com.hh.bss.project.dao.*;
import com.hh.bss.project.entity.*;
import com.hh.bss.project.service.*;
import com.hh.bss.project.vo.query.*;
import com.hh.bss.util.*;




@Service
@Transactional
public class ContractJobCvInterviewServiceImpl extends BaseBusinessService<ContractJobCvInterview,java.lang.Integer>  implements ContractJobCvInterviewService<ContractJobCvInterview,java.lang.Integer>{

	private ContractJobCvInterviewDao contractJobCvInterviewDao;
	/**增加setXXXX()方法,spring就可以通过autowire自动设置对象属性,请注意大小写*/
	public void setContractJobCvInterviewDaoImpl(ContractJobCvInterviewDao dao) {
		this.contractJobCvInterviewDao = dao;
	}
	private ContractJobCvRecomService contractJobCvRecomService;
	public void setContractJobCvRecomServiceImpl(ContractJobCvRecomService service) {
		this.contractJobCvRecomService = service;
	}
	
	public EntityDao getEntityDao() {
		return this.contractJobCvInterviewDao;
	}
	
	@Transactional(readOnly=true)
	public Page findPage(ContractJobCvInterviewQuery query) {
		return contractJobCvInterviewDao.findPage(query);
	}
	public Page findJobCvInterviewPage(ContractJobCvInterviewQuery query){
		return contractJobCvInterviewDao.findJobCvInterviewPage(query);
	}
	public void save(ContractJobCvInterview contractJobCvInterview){
		
		contractJobCvInterviewDao.save(contractJobCvInterview);
		contractJobCvInterviewDao.flush();
		ContractJobCvRecom contractJobCvRecom=new ContractJobCvRecom();
		contractJobCvRecom.setId(contractJobCvInterview.getRecomId());
		contractJobCvRecom.setProjectCvStatus(SearchProjectCv.STATUS_KI);
		contractJobCvRecomService.updateRecomStatus(contractJobCvRecom);
		
    }

	@Override
	public Page findCvInterviewPage(ContractJobCvInterviewQuery contractJobCvInterviewQuery) {
		
		return  contractJobCvInterviewDao.findCvInterviewPage(contractJobCvInterviewQuery);
	}		
}
